All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class quicktime.util.EndianOrder

java.lang.Object
   |
   +----quicktime.util.EndianOrder

public final class EndianOrder
extends Object
The endian methods in this class are context sensitive, in that the big-endian methods will only flip if the current platform is little endian and the little-endian methods will only flip if the current platform is big endian.

The names of the methods are provided as a means of documenting the usage of the method itself. To operate as specified they rely upon the application correctly providing the expected endian-ordered number to the method. Thus, the flipNativeToBigEndian and flipBigEndianToNative will both flip when executed on a little-endian architecture but the methods are unable to determine if the argument is actually (in this case) in native little-endian order or big endian order. The application itself must ensure that the provided argument is correct for these methods to return their exepcted result.


Method Index

 o flipBigEndianToNative(Object, int, EndianDescriptor)
This will flip, iff the current runtime architecture is little endian, the supplied src object's fields according to the characteristics of the supplied EndianDescriptor.
 o flipBigEndianToNative(Object, int, Object, int, EndianDescriptor)
This will flip, iff the current runtime architecture is little endian, the supplied src object's fields according to the characteristics of the supplied EndianDescriptor and copy these flipped values to the destination object.
 o flipBigEndianToNative16(short)
This will flip the endian order of a 16bit value iff the current runtime architecture is little endian, otherwise the returned value is the same as the supplied value.
 o flipBigEndianToNative32(int)
This will flip the endian order of a 32bit value iff the current runtime architecture is little endian, otherwise the returned value is the same as the supplied value.
 o flipBigEndianToNative64(long)
This will flip the endian order of a 64bit value iff the current runtime architecture is little endian, otherwise the returned value is the same as the supplied value.
 o flipLittleEndianToNative(Object, int, EndianDescriptor)
This will flip, iff the current runtime architecture is big endian, the supplied src object's fields according to the characteristics of the supplied EndianDescriptor.
 o flipLittleEndianToNative(Object, int, Object, int, EndianDescriptor)
This will flip, iff the current runtime architecture is big endian, the supplied src object's fields according to the characteristics of the supplied EndianDescriptor and copy these flipped values to the destination object.
 o flipLittleEndianToNative16(short)
This will flip the endian order of a 16bit value iff the current runtime architecture is big endian, otherwise the returned value is the same as the supplied value.
 o flipLittleEndianToNative32(int)
This will flip the endian order of a 32bit value iff the current runtime architecture is big endian, otherwise the returned value is the same as the supplied value.
 o flipLittleEndianToNative64(long)
This will flip the endian order of a 64bit value iff the current runtime architecture is big endian, otherwise the returned value is the same as the supplied value.
 o flipNativeToBigEndian(Object, int, EndianDescriptor)
This will flip iff the current runtime architecture is little endian the supplied src object's fields according to the characteristics of the supplied EndianDescriptor.
 o flipNativeToBigEndian(Object, int, Object, int, EndianDescriptor)
This will flip, iff the current runtime architecture is little endian, the supplied src object's fields according to the characteristics of the supplied EndianDescriptor and copy these flipped values to the destination object.
 o flipNativeToBigEndian16(short)
This will flip the endian order of a 16bit value iff the current runtime architecture is little endian, otherwise the returned value is the same as the supplied value.
 o flipNativeToBigEndian32(int)
This will flip the endian order of a 32bit value iff the current runtime architecture is little endian, otherwise the returned value is the same as the supplied value.
 o flipNativeToBigEndian64(long)
This will flip the endian order of a 64bit value iff the current runtime architecture is little endian, otherwise the returned value is the same as the supplied value.
 o flipNativeToLittleEndian(Object, int, EndianDescriptor)
This will flip, iff the current runtime architecture is big endian, the supplied src object's fields according to the characteristics of the supplied EndianDescriptor.
 o flipNativeToLittleEndian(Object, int, Object, int, EndianDescriptor)
This will flip, iff the current runtime architecture is big endian, the supplied src object's fields according to the characteristics of the supplied EndianDescriptor and copy these flipped values to the destination object.
 o flipNativeToLittleEndian16(short)
This will flip the endian order of a 16bit value iff the current runtime architecture is big endian, otherwise the returned value is the same as the supplied value.
 o flipNativeToLittleEndian32(int)
This will flip the endian order of a 32bit value iff the current runtime architecture is big endian, otherwise the returned value is the same as the supplied value.
 o flipNativeToLittleEndian64(long)
This will flip the endian order of a 64bit value iff the current runtime architecture is big endian, otherwise the returned value is the same as the supplied value.
 o isNativeBigEndian()
Returns true if the current runtime architecture is big endian.
 o isNativeLittleEndian()
Returns true if the current runtime architecture is little endian.

Methods

 o isNativeLittleEndian
 public static boolean isNativeLittleEndian()
Returns true if the current runtime architecture is little endian.

Returns:
a boolean
 o isNativeBigEndian
 public static boolean isNativeBigEndian()
Returns true if the current runtime architecture is big endian.

Returns:
a boolean
 o flipNativeToBigEndian16
 public static short flipNativeToBigEndian16(short s)
This will flip the endian order of a 16bit value iff the current runtime architecture is little endian, otherwise the returned value is the same as the supplied value.

Parameters:
s - the value to flip
Returns:
the flipped value if the runtime architecture is little endian, otherwise the original value
 o flipBigEndianToNative16
 public static short flipBigEndianToNative16(short s)
This will flip the endian order of a 16bit value iff the current runtime architecture is little endian, otherwise the returned value is the same as the supplied value.

Parameters:
s - the value to flip
Returns:
the flipped value if the runtime architecture is little endian, otherwise the original value
 o flipNativeToLittleEndian16
 public static short flipNativeToLittleEndian16(short s)
This will flip the endian order of a 16bit value iff the current runtime architecture is big endian, otherwise the returned value is the same as the supplied value.

Parameters:
s - the value to flip
Returns:
the flipped value if the runtime architecture is big endian, otherwise the original value
 o flipLittleEndianToNative16
 public static short flipLittleEndianToNative16(short s)
This will flip the endian order of a 16bit value iff the current runtime architecture is big endian, otherwise the returned value is the same as the supplied value.

Parameters:
s - the value to flip
Returns:
the flipped value if the runtime architecture is big endian, otherwise the original value
 o flipNativeToBigEndian32
 public static int flipNativeToBigEndian32(int i)
This will flip the endian order of a 32bit value iff the current runtime architecture is little endian, otherwise the returned value is the same as the supplied value.

Parameters:
i - the value to flip
Returns:
the flipped value if the runtime architecture is little endian, otherwise the original value
 o flipBigEndianToNative32
 public static int flipBigEndianToNative32(int i)
This will flip the endian order of a 32bit value iff the current runtime architecture is little endian, otherwise the returned value is the same as the supplied value.

Parameters:
i - the value to flip
Returns:
the flipped value if the runtime architecture is little endian, otherwise the original value
 o flipNativeToLittleEndian32
 public static int flipNativeToLittleEndian32(int i)
This will flip the endian order of a 32bit value iff the current runtime architecture is big endian, otherwise the returned value is the same as the supplied value.

Parameters:
i - the value to flip
Returns:
the flipped value if the runtime architecture is big endian, otherwise the original value
 o flipLittleEndianToNative32
 public static int flipLittleEndianToNative32(int i)
This will flip the endian order of a 32bit value iff the current runtime architecture is big endian, otherwise the returned value is the same as the supplied value.

Parameters:
i - the value to flip
Returns:
the flipped value if the runtime architecture is big endian, otherwise the original value
 o flipNativeToBigEndian64
 public static long flipNativeToBigEndian64(long l)
This will flip the endian order of a 64bit value iff the current runtime architecture is little endian, otherwise the returned value is the same as the supplied value.

Parameters:
l - the value to flip
Returns:
the flipped value if the runtime architecture is little endian, otherwise the original value
 o flipBigEndianToNative64
 public static long flipBigEndianToNative64(long l)
This will flip the endian order of a 64bit value iff the current runtime architecture is little endian, otherwise the returned value is the same as the supplied value.

Parameters:
l - the value to flip
Returns:
the flipped value if the runtime architecture is little endian, otherwise the original value
 o flipNativeToLittleEndian64
 public static long flipNativeToLittleEndian64(long l)
This will flip the endian order of a 64bit value iff the current runtime architecture is big endian, otherwise the returned value is the same as the supplied value.

Parameters:
l - the value to flip
Returns:
the flipped value if the runtime architecture is big endian, otherwise the original value
 o flipLittleEndianToNative64
 public static long flipLittleEndianToNative64(long l)
This will flip the endian order of a 64bit value iff the current runtime architecture is big endian, otherwise the returned value is the same as the supplied value.

Parameters:
l - the value to flip
Returns:
the flipped value if the runtime architecture is big endian, otherwise the original value
 o flipNativeToBigEndian
 public static void flipNativeToBigEndian(Object src,
                                          int srcOffset,
                                          EndianDescriptor ed) throws UtilException
This will flip iff the current runtime architecture is little endian the supplied src object's fields according to the characteristics of the supplied EndianDescriptor. The EndianDescriptor will be applied to the src object at the specified (srcOffset) number of bytes from the beginning of the src object. The flipping is done in place, so the srcObject will be flipped upon the completion of this method. Any fields that are not described or accounted for by the EndianDescriptor will not be flipped.

Parameters:
src - the object to flip iff the current runtime architecture is little endian
srcOffset - the number of bytes from the start of the src object that the supplied endian descriptor will be applied.
ed - the EndianDescriptor that will describe how the object should be flipped. This may NOT be null.
See Also:
EndianOrder
 o flipBigEndianToNative
 public static void flipBigEndianToNative(Object src,
                                          int srcOffset,
                                          EndianDescriptor ed) throws UtilException
This will flip, iff the current runtime architecture is little endian, the supplied src object's fields according to the characteristics of the supplied EndianDescriptor. It the current runtime architecture is big endian the src object is left unchanged. The EndianDescriptor will be applied to the src object at the specified (srcOffset) number of bytes from the beginning of the src object. The flipping is done in place, so the srcObject will be flipped upon the completion of this method. Any fields that are not described or accounted for by the EndianDescriptor will not be flipped.

Parameters:
src - the object to flip iff the current runtime architecture is little endian
srcOffset - the number of bytes from the start of the src object that the supplied endian descriptor will be applied.
ed - the EndianDescriptor that will describe how the object should be flipped. This may NOT be null.
See Also:
EndianOrder
 o flipNativeToLittleEndian
 public static void flipNativeToLittleEndian(Object src,
                                             int srcOffset,
                                             EndianDescriptor ed) throws UtilException
This will flip, iff the current runtime architecture is big endian, the supplied src object's fields according to the characteristics of the supplied EndianDescriptor. It the current runtime architecture is little endian the src object is left unchanged. The EndianDescriptor will be applied to the src object at the specified (srcOffset) number of bytes from the beginning of the src object. The flipping is done in place, so the srcObject will be flipped upon the completion of this method. Any fields that are not described or accounted for by the EndianDescriptor will not be flipped.

Parameters:
src - the object to flip iff the current runtime architecture is big endian
srcOffset - the number of bytes from the start of the src object that the supplied endian descriptor will be applied.
ed - the EndianDescriptor that will describe how the object should be flipped. This may NOT be null.
 o flipLittleEndianToNative
 public static void flipLittleEndianToNative(Object src,
                                             int srcOffset,
                                             EndianDescriptor ed) throws UtilException
This will flip, iff the current runtime architecture is big endian, the supplied src object's fields according to the characteristics of the supplied EndianDescriptor. It the current runtime architecture is little endian the src object is left unchanged. The EndianDescriptor will be applied to the src object at the specified (srcOffset) number of bytes from the beginning of the src object. The flipping is done in place, so the srcObject will be flipped upon the completion of this method. Any fields that are not described or accounted for by the EndianDescriptor will not be flipped.

Parameters:
src - the object to flip iff the current runtime architecture is big endian
srcOffset - the number of bytes from the start of the src object that the supplied endian descriptor will be applied.
ed - the EndianDescriptor that will describe how the object should be flipped. This may NOT be null.
 o flipNativeToBigEndian
 public static void flipNativeToBigEndian(Object src,
                                          int srcOffset,
                                          Object dest,
                                          int destOffset,
                                          EndianDescriptor ed) throws UtilException
This will flip, iff the current runtime architecture is little endian, the supplied src object's fields according to the characteristics of the supplied EndianDescriptor and copy these flipped values to the destination object. It the current runtime architecture is big endian the src object is left unchanged. The EndianDescriptor will be applied to the src object at the specified (srcOffset) number of bytes from the beginning of the src object and the flipped values will be copied to the specified (destOffset) number of bytes into the destination object. Any fields that are not described or accounted for by the EndianDescriptor will not be flipped or copied.

Parameters:
src - the object to flip iff the current runtime architecture is little endian
srcOffset - the number of bytes from the start of the src object that the supplied endian descriptor will be applied.
dest - the object that will be the flipped version of the source object.
destOffset - the number of bytes from the start of the dest object that the flipped values will be copied too.
ed - the EndianDescriptor that will describe how the object should be flipped. This may NOT be null.
 o flipBigEndianToNative
 public static void flipBigEndianToNative(Object src,
                                          int srcOffset,
                                          Object dest,
                                          int destOffset,
                                          EndianDescriptor ed) throws UtilException
This will flip, iff the current runtime architecture is little endian, the supplied src object's fields according to the characteristics of the supplied EndianDescriptor and copy these flipped values to the destination object. It the current runtime architecture is big endian the src object is left unchanged. The EndianDescriptor will be applied to the src object at the specified (srcOffset) number of bytes from the beginning of the src object and the flipped values will be copied to the specified (destOffset) number of bytes into the destination object. Any fields that are not described or accounted for by the EndianDescriptor will not be flipped or copied.

Parameters:
src - the object to flip iff the current runtime architecture is little endian
srcOffset - the number of bytes from the start of the src object that the supplied endian descriptor will be applied.
dest - the object that will be the flipped version of the source object.
destOffset - the number of bytes from the start of the dest object that the flipped values will be copied too.
ed - the EndianDescriptor that will describe how the object should be flipped. This may NOT be null.
 o flipNativeToLittleEndian
 public static void flipNativeToLittleEndian(Object src,
                                             int srcOffset,
                                             Object dest,
                                             int destOffset,
                                             EndianDescriptor ed) throws UtilException
This will flip, iff the current runtime architecture is big endian, the supplied src object's fields according to the characteristics of the supplied EndianDescriptor and copy these flipped values to the destination object. It the current runtime architecture is little endian the src object is left unchanged. The EndianDescriptor will be applied to the src object at the specified (srcOffset) number of bytes from the beginning of the src object and the flipped values will be copied to the specified (destOffset) number of bytes into the destination object. Any fields that are not described or accounted for by the EndianDescriptor will not be flipped or copied.

Parameters:
src - the object to flip iff the current runtime architecture is big endian
srcOffset - the number of bytes from the start of the src object that the supplied endian descriptor will be applied.
dest - the object that will be the flipped version of the source object.
destOffset - the number of bytes from the start of the dest object that the flipped values will be copied too.
ed - the EndianDescriptor that will describe how the object should be flipped. This may NOT be null.
 o flipLittleEndianToNative
 public static void flipLittleEndianToNative(Object src,
                                             int srcOffset,
                                             Object dest,
                                             int destOffset,
                                             EndianDescriptor ed) throws UtilException
This will flip, iff the current runtime architecture is big endian, the supplied src object's fields according to the characteristics of the supplied EndianDescriptor and copy these flipped values to the destination object. It the current runtime architecture is little endian the src object is left unchanged. The EndianDescriptor will be applied to the src object at the specified (srcOffset) number of bytes from the beginning of the src object and the flipped values will be copied to the specified (destOffset) number of bytes into the destination object. Any fields that are not described or accounted for by the EndianDescriptor will not be flipped or copied.

Parameters:
src - the object to flip iff the current runtime architecture is big endian
srcOffset - the number of bytes from the start of the src object that the supplied endian descriptor will be applied.
dest - the object that will be the flipped version of the source object.
destOffset - the number of bytes from the start of the dest object that the flipped values will be copied too.
ed - the EndianDescriptor that will describe how the object should be flipped. This may NOT be null.

All Packages  Class Hierarchy  This Package  Previous  Next  Index